const moduleA = {
  state: () => ({
    column: [],
  }),
  mutations: {
    // 添加一行数据
    addColumnOne(state, oneColumn) {
      if (!state.column.includes(oneColumn.id)) {
        state.column.push(oneColumn);
      }
    },
    // 便捷需修改别名
    resetQname(state, params) {
      state.column[params.index].name = params.name;
    },
    // 修改一个数据
    resetOneColumn(state, params) {
      console.log(params);
      let id = params.id;
      state.column.forEach((item, index) => {
        if (item.id == id) {
          console.log(index);
          state.column.splice(index, 1, params);
        }
      });
    },
    delOneCol(state, params) {
      console.log(params.id);
      let id = params.id;
      state.column.forEach((item, index) => {
        if (item.id == id) {
          console.log(index);
          state.column.splice(index, 1);
        }
      });
      if (params.arry > 1) {
      }
      console.log(params);
    },
  },
  actions: {},
  getters: {},
};

export default moduleA;
